package com.situ.blog.action;

import com.opensymphony.xwork2.ActionSupport;
import com.situ.blog.pojo.vo.BlogTypeCountVO;
import com.situ.blog.service.IBlogTypeService;
import com.situ.blog.util.JSONUtil;
import com.situ.blog.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
public class EChartsAction extends ActionSupport {
    @Autowired
    private IBlogTypeService blogTypeService;

    //跳转到echarts页面
    public String toECharts() {
        return "echarts";
    }

    public void selectBlogTypeCount() {
        List<BlogTypeCountVO> list = blogTypeService.selectBlogTypeCount();
        JSONUtil.toJSON(Result.ok(list));
    }
}
